<?php

namespace App\Api;

use App\Domain\UserReportClassifyDomain;
use PhalApi\Api;
use App\Domain\User as Domain_User;
use App\Model\Zlive as Model_Zlive;
use App\Model\Photo as Model_Photo;
use App\Model\Dynamic as Model_Dynamic;
use App\Model\Video as Model_Video;
use App\Domain\Vip as Domain_Vip;

/**
 * 用户信息类
 */
class User extends Api
{

    public function getRules()
    {
        return array(

            'getBaseInfo' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'desc' => '用户token'),
                'ios_version' => array('name' => 'ios_version', 'type' => 'string', 'default' => '', 'desc' => 'IOS版本号'),
            ),
            'setVoiceSwitch' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'desc' => '用户token'),
                'isvoice' => array('name' => 'isvoice', 'type' => 'string', 'default' => '0', 'desc' => '开关，0关1开'),
            ),
            'setVoiceValue' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'desc' => '用户token'),
                'value' => array('name' => 'value', 'type' => 'string', 'default' => '0', 'desc' => '价格'),
            ),
            'setVideoSwitch' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'desc' => '用户token'),
                'isvideo' => array('name' => 'isvideo', 'type' => 'string', 'default' => '0', 'desc' => '开关，0关1开'),
            ),
            'setVideoValue' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'desc' => '用户token'),
                'value' => array('name' => 'value', 'type' => 'string', 'default' => '0', 'desc' => '价格'),
            ),

            'setDisturbSwitch' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'desc' => '用户token'),
                'isdisturb' => array('name' => 'isdisturb', 'type' => 'string', 'default' => '0', 'desc' => '开关，0关1开'),
            ),

            'upUserInfo' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'desc' => '用户token'),
                'avatar' => array('name' => 'avatar', 'type' => 'string', 'default' => '', 'desc' => '头像'),
                'name' => array('name' => 'name', 'type' => 'string', 'default' => '', 'desc' => '昵称'),
                'audio' => array('name' => 'audio', 'type' => 'string', 'default' => '', 'desc' => '语音'),
                'audio_length' => array('name' => 'audio_length', 'type' => 'int', 'default' => '0', 'desc' => '语音时长'),
                'sex' => array('name' => 'sex', 'type' => 'string', 'desc' => '性别,1男2女'),
                'height' => array('name' => 'height', 'type' => 'string', 'desc' => '身高'),
                'weight' => array('name' => 'weight', 'type' => 'string', 'desc' => '体重'),
                'constellation' => array('name' => 'constellation', 'type' => 'string', 'desc' => '星座'),
                'label' => array('name' => 'label', 'type' => 'string', 'desc' => '形象标签ID,多个标签用逗号拼接'),
                'province' => array('name' => 'province', 'type' => 'string', 'desc' => '所在城市-省'),
                'city' => array('name' => 'city', 'type' => 'string', 'desc' => '所在城市-市'),
                'district' => array('name' => 'district', 'type' => 'string', 'desc' => '所在城市-区'),
                'intr' => array('name' => 'intr', 'type' => 'string', 'desc' => '个人介绍'),
                'signature' => array('name' => 'signature', 'type' => 'string', 'desc' => '个性签名'),
                'language' => array('name' => 'language', 'type' => 'string', 'desc' => '语言'),
                'country' => array('name' => 'country', 'type' => 'string', 'desc' => '国家'),
                'address' => array('name' => 'address', 'type' => 'string', 'desc' => '详细地址'),
            ),
            'getFollowsList' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'desc' => '用户token'),
                'p' => array('name' => 'p', 'type' => 'int', 'default' => 1, 'desc' => '页数'),
            ),
            'getFansList' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'desc' => '用户token'),
                'p' => array('name' => 'p', 'type' => 'int', 'default' => 1, 'desc' => '页数'),
            ),

            'setAttent' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'desc' => '用户token'),
                'touid' => array('name' => 'touid', 'type' => 'int', 'desc' => '对方ID'),
            ),

            'getBlackList' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'desc' => '用户token'),
                'p' => array('name' => 'p', 'type' => 'int', 'default' => 1, 'desc' => '页数'),
            ),

            'setBlack' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'desc' => '用户token'),
                'touid' => array('name' => 'touid', 'type' => 'int', 'desc' => '对方ID'),
            ),

            'setLocal' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'desc' => '用户token'),
                'lng' => array('name' => 'lng', 'type' => 'string', 'desc' => '经度'),
                'lat' => array('name' => 'lat', 'type' => 'string', 'desc' => '纬度'),
            ),

            'getGiftCab' => array(
                'liveuid' => array('name' => 'liveuid', 'type' => 'int', 'desc' => '主播ID'),
            ),

            'getUserHome' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'liveuid' => array('name' => 'liveuid', 'type' => 'int', 'desc' => '主播ID'),
            ),


            'setReport' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
                'touid' => array('name' => 'touid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '对方ID'),
                'content' => array('name' => 'content', 'type' => 'string', 'min' => 1, 'require' => true, 'desc' => '举报内容'),
            ),

            'setBeauty' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
                'type' => array('name' => 'type', 'type' => 'int', 'default' => 1, 'require' => true, 'desc' => '类型, 1腾讯云 2美狐'),
                'preinstall' => array('name' => 'preinstall', 'type' => 'string', 'require' => true, 'desc' => '美颜预设值json格式'),

            ),

            'getBeauty' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),


            ),
            'getRecommendlist' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
                'p' => array('name' => 'p', 'type' => 'int', 'default' => 1, 'desc' => '页数'),

            ),
            'getUserList' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
                'p' => array('name' => 'p', 'type' => 'int', 'default' => 1, 'desc' => '页数'),
                'type' => array('name' => 'type', 'type' => 'int', 'default' => 1, 'desc' => '筛选条件1全部，2未认证，3已认证'),
            ),
            'setUserInfo' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
                'avatar' => array('name' => 'avatar', 'type' => 'string', 'desc' => '头像'),
                'name' => array('name' => 'name', 'type' => 'string', 'desc' => '昵称'),
                'sex' => array('name' => 'sex', 'type' => 'string', 'desc' => '性别'),
                'country' => array('name' => 'country', 'type' => 'string', 'desc' => '国家'),
                'language' => array('name' => 'language', 'type' => 'string', 'desc' => '语言'),
            ),

            'getUserMaterial' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
            ),

            'checkTeenager' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
            ),

            'setTeenagerPassword' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
                'password' => array('name' => 'password', 'type' => 'string', 'require' => true, 'desc' => '青少年模式密码'),
                'type' => array('name' => 'type', 'type' => 'int', 'require' => true, 'desc' => '操作类型 0 设置密码 1开启青少年模式'),
            ),

            'updateTeenagerPassword' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
                'oldpassword' => array('name' => 'oldpassword', 'type' => 'string', 'require' => true, 'desc' => '青少年模式旧密码'),
                'password' => array('name' => 'password', 'type' => 'string', 'require' => true, 'desc' => '青少年模式新密码'),
            ),

            'closeTeenager' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
                'password' => array('name' => 'password', 'type' => 'string', 'require' => true, 'desc' => '青少年模式密码'),
            ),

            'addTeenagerTime' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
            ),

            'Bonus' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
            ),
            'getBonus' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
            ),

            'getTaskList' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
            ),

            'receiveTaskReward' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
                'type' => array('name' => 'type', 'type' => 'string', 'require' => true, 'desc' => '操作类型 ')
            ),

            'guardList' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'require' => true, 'desc' => '用户ID'),
                'p' => array('name' => 'p', 'type' => 'int', 'default' => '1', 'desc' => '页数'),
                'type' => array('name' => 'type', 'type' => 'string', 'default' => 'day', 'desc' => '参数类型，day表示日榜，week表示周榜，month代表月榜，total代表总榜'),
            ),

            'getRandomSayhi' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
            ),

            'addFirstSayhiRecord' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
                'touid' => array('name' => 'touid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '对方ID'),
            ),


            'getLikeList' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'desc' => '用户ID'),
                'token' => array('name' => 'token', 'type' => 'string', 'desc' => '用户token'),
                'p' => array('name' => 'p', 'type' => 'int', 'default' => 1, 'desc' => '页数'),
            ),
            'getReportClass' => [
                'langId' => ['name' => 'langId', 'type' => 'int', 'desc' => '语种ID']
            ]
        );
    }

    /**
     * 登录时设置头像、昵称及性别
     * @desc 用于登录时设置头像、昵称及性别
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function setUserInfo()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('操作成功'), 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $avatar = \App\checkNull($this->avatar);
        $name = \App\checkNull($this->name);
        $sex = \App\checkNull($this->sex);
        $country = \App\checkNull($this->country);
        $language = \App\checkNull($this->language);

        /*if($name==''){
            $rs['code'] = 1001;
            $rs['msg'] = \PhalApi\T('请填写昵称');
            return $rs;
        }*/

        /*$is_has_sensitive=\App\checkSensitiveWords($name);

        if($is_has_sensitive){
        	$rs['code'] = 1001;
			$rs['msg'] = \PhalApi\T('昵称输入非法,请重新输入');
			return $rs;
        }*/

        if ($sex == '') {
            $rs['code'] = 1002;
            $rs['msg'] = \PhalApi\T('请选择性别');
            return $rs;
        }

        if ($country == '') {
            $rs['code'] = 1002;
            $rs['msg'] = \PhalApi\T('请选择国家');
            return $rs;
        }

        if ($language == '') {
            $rs['code'] = 1002;
            $rs['msg'] = \PhalApi\T('请选择语言');
            return $rs;
        }

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->setUserInfo($uid, $avatar, $name, $sex, $country, $language);

        return $info;
    }

    /**
     * 获取首页用户列表信息
     * @desc 用于获取首页用户列表信息
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function getUserList()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $p = \App\checkNull($this->p);
        $type = \App\checkNull($this->type);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->getUserList($uid, $p, $type);


        $rs['info'] = $info;

        return $rs;
    }

    /**
     * 获取首页打招呼推荐用户信息
     * @desc 用于获取首页打招呼推荐用户信息
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function getRecommendlist()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $p = \App\checkNull($this->p);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->getRecommendlist($p, $uid);
        if (!$info) {
            $rs['code'] = 1001;
            $rs['msg'] = \PhalApi\T('暂无认证用户'); //暂无认证用户
            return $rs;
        }
        //处理总页数
        $nums = \PhalApi\DI()->notorm->user
            ->where('isauthor_auth=1')
            ->count();
        $pages = ceil($nums / 3);
        $rs['info']['pages'] = $pages;
        $configpri = \App\getConfigPri();
        // 处理推荐框文案
        $rs['info']['recommendinfo'] = $configpri['recommendinfo'];
        // 获取打招呼文案信息
        $sayhelloinfo = $domain->getSayhelloinfo();
        //处理打招呼文案信息
        $rs['info']['sayhelloinfo'] = $sayhelloinfo;

        $rs['info']['recommendlist'] = $info;

        return $rs;
    }


    /**
     * 获取用户信息
     * @desc 用于获取单个用户基本信息
     * @return int code 操作码，0表示成功， 1表示用户不存在
     * @return array info
     * @return array info[0] 用户信息
     * @return int info[0].id 用户ID
     * @return string info[0].level 等级
     * @return string info[0].follows 关注数
     * @return string info[0].fans 粉丝数
     * @return string info[0].isvoice 语音开关，0关1开
     * @return string info[0].voice_value 语音价格
     * @return string info[0].isvideo 视频开关，0关1开
     * @return string info[0].video_value 视频价格
     * @return string info[0].isdisturb 勿扰开关，0关1开
     * @return array info[0].voicelist 语音价格列表
     * @return string info[0].voicelist[].coin 价格
     * @return string info[0].voicelist[].canselect 能否选择0否1是
     * @return array info[0].videolist 视频价格列表
     * @return string info[0].videolist[].coin 价格
     * @return string info[0].videolist[].canselect 能否选择0否1是
     * @return string info[0].isvip 是否VIP，0否1是
     * @return string info[0].family_switch 家族开关
     * @return string info[0].isauth 是否主播认证 0否1是
     * @return string info[0].isuser_auth 是否实名认证 0否1是
     * @return string msg 提示信息
     */
    public function getBaseInfo()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);

        $checkToken = \App\checkToken($uid, $token);

        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->getBaseInfo($uid);

        $configpub = \App\getConfigPub();
        $configpri = \App\getConfigPri();

        $ios_shelves = $configpub['ios_shelves'];

        $family_switch = $configpri['family_switch'];
        $service_switch = $configpri['service_switch'];
        $service_url = $configpri['service_url'];
        $agent_switch = $configpri['agent_switch'];


        /* 个人中心菜单 */
        $ios_version = \App\checkNull($this->ios_version);

        $list = array();
        $shelves = 1;
        if ($ios_version && $ios_version == $ios_shelves) {
            $shelves = 0;
            $family_switch = 0;
        }

        $info['family_switch'] = $family_switch;

        $family_status = 0;

        if ($family_switch) {
            $family_status = \App\checkUserFamily($uid);
        }

        if ($family_status) {
            $info['family_url'] = \App\get_upload_path('/appapi/Family/home');
        } else {
            $info['family_url'] = \App\get_upload_path('/appapi/Family/index');
        }

        $info['family_status'] = (string)$family_status;

        $info['agent_switch'] = $agent_switch;

        $isauth = \App\isAuthorAuth($uid);

        $info['isauth'] = $isauth;
        $info['isuser_auth'] = \App\isAuth($uid);


        if ($isauth == 1) {

            $checkTeenager = $domain->checkTeenager($uid);

            //开启了青少年模式
            if ($checkTeenager['info'][0]['is_setpassword'] == 1 && $checkTeenager['info'][0]['status'] == 1) {
                $list[] = array('id' => '3', 'name' => \PhalApi\T('我的动态'), 'thumb' => \App\get_upload_path("/static/app/person/dynamic.png"), 'href' => '');
            } else {

                $list[] = array('id' => '18', 'name' => \PhalApi\T('任务中心'), 'thumb' => \App\get_upload_path("/static/app/person/task.png"), 'href' => '');
                $list[] = array('id' => '17', 'name' => \PhalApi\T('房间管理'), 'thumb' => \App\get_upload_path("/static/app/person/room.png"), 'href' => '');
                $list[] = array('id' => '11', 'name' => \PhalApi\T('背景墙'), 'thumb' => \App\get_upload_path("/static/app/person/back.png"), 'href' => '');
                $list[] = array('id' => '12', 'name' => \PhalApi\T('我的视频'), 'thumb' => \App\get_upload_path("/static/app/person/video.png"), 'href' => '');
                $list[] = array('id' => '13', 'name' => \PhalApi\T('我的相册'), 'thumb' => \App\get_upload_path("/static/app/person/photo.png"), 'href' => '');
                $list[] = array('id' => '3', 'name' => \PhalApi\T('我的动态'), 'thumb' => \App\get_upload_path("/static/app/person/dynamic.png"), 'href' => '');
                $list[] = array('id' => '4', 'name' => \PhalApi\T('我的印象'), 'thumb' => \App\get_upload_path("/static/app/person/impression.png"), 'href' => '');
                $list[] = array('id' => '5', 'name' => \PhalApi\T('礼物柜'), 'thumb' => \App\get_upload_path("/static/app/person/gift.png"), 'href' => '');
                $list[] = array('id' => '15', 'name' => \PhalApi\T('通话设置'), 'thumb' => \App\get_upload_path("/static/app/person/conversation.png"), 'href' => '');
            }


        } else {
            $list[] = array('id' => '18', 'name' => \PhalApi\T('任务中心'), 'thumb' => \App\get_upload_path("/static/app/person/task.png"), 'href' => '');
        }


        //在线客服
        if ($service_switch && $service_url) {
            $list[] = array('id' => '14', 'name' => \PhalApi\T('在线客服'), 'thumb' => \App\get_upload_path("/static/app/person/service.png"), 'href' => $service_url);
        }

        $list[] = array('id' => '16', 'name' => \PhalApi\T('青少年模式'), 'thumb' => \App\get_upload_path("/static/app/person/teenager.png"), 'href' => '');

        $info['list'] = $list;

        /* 语音价格 */
        $voicelist = $domain->getVoice();
        foreach ($voicelist as $k => $v) {
            $v['canselect'] = '0';
            if ($v['level'] <= $info['level_anchor']) {
                $v['canselect'] = '1';
            }
            $voicelist[$k] = $v;
        }
        $info['voicelist'] = $voicelist;
        /* 视频价格 */
        $videolist = $domain->getVideo();
        foreach ($videolist as $k => $v) {
            $v['canselect'] = '0';
            if ($v['level'] <= $info['level_anchor']) {
                $v['canselect'] = '1';
            }
            $videolist[$k] = $v;
        }
        $info['videolist'] = $videolist;
        //guo
        if (!empty($info['birthday'])) {
            $info['birthday_'] = date('Y-m-d H:i:s', $info['birthday']);
            $info['age'] = (int)((time() - $info['birthday']) / (365 * 24 * 60 * 60));
        }
        $rs['info'][0] = $info;

        return $rs;
    }

    /**
     * 语音开关
     * @desc 用于用户设置语音聊天开关
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function setVoiceSwitch()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('操作成功'), 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $isvoice = \App\checkNull($this->isvoice);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->setVoiceSwitch($uid, $isvoice);

        return $info;
    }

    /**
     * 语音价格
     * @desc 用于用户设置语音聊天价格
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function setVoiceValue()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('操作成功'), 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $value = \App\checkNull($this->value);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->setVoiceValue($uid, $value);

        return $info;
    }

    /**
     * 语音收费说明
     * @desc 用于查看收费说明
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function getVoiceInfo()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $domain = new Domain_User();
        $levellist = \App\getLevelanchorList();
        $list = $domain->getVoice();
        foreach ($levellist as $k => $v) {
            $v['coin'] = '0';
            foreach ($list as $k1 => $v1) {
                if ($v['level'] >= $v1['level']) {
                    $v['coin'] = $v1['coin'];
                }
            }
            unset($v['id']);
            unset($v['level_up']);

            $levellist[$k] = $v;
        }

        $rs['info'] = $levellist;
        return $rs;
    }

    /**
     * 视频开关
     * @desc 用于用户设置视频聊天开关
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function setVideoSwitch()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('操作成功'), 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $isvideo = \App\checkNull($this->isvideo);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->setVideoSwitch($uid, $isvideo);

        return $info;
    }

    /**
     * 视频价格
     * @desc 用于用户设置视频聊天价格
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function setVideoValue()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('操作成功'), 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $value = \App\checkNull($this->value);
        $pattern = "/^[1-9][0-9]*$/";
        if (!preg_match($pattern, $value)) {
            $rs['code'] = 1001;
            $rs['msg'] = \PhalApi\T('请输入整数');
            return $rs;
        }

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->setVideoValue($uid, $value);

        return $info;
    }

    /**
     * 视频收费说明
     * @desc 用于查看收费说明
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string info[].thumb 等级图标
     * @return string info[].coin 价格
     * @return string msg 提示信息
     */
    public function getVideoInfo()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $domain = new Domain_User();
        $levellist = \App\getLevelanchorList();
        $list = $domain->getVideo();
        foreach ($levellist as $k => $v) {
            $v['coin'] = '0';
            foreach ($list as $k1 => $v1) {
                if ($v['level'] >= $v1['level']) {
                    $v['coin'] = $v1['coin'];
                }
            }
            unset($v['id']);
            unset($v['level_up']);
            $levellist[$k] = $v;
        }

        $rs['info'] = $levellist;
        return $rs;
    }

    /**
     * 勿扰开关
     * @desc 用于用户设置勿扰开关
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function setDisturbSwitch()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('操作成功'), 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $isdisturb = \App\checkNull($this->isdisturb);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->setDisturbSwitch($uid, $isdisturb);

        return $info;
    }

    /**
     * 编辑用户资料
     * @desc 用于编辑用户资料
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string info[0].avatar 头像
     * @return string info[0].avatar_thumb 小头像
     * @return string info[0].user_nickname 昵称
     * @return string info[0].audio 语音自我介绍
     * @return int info[0].audio_length 语音时长
     * @return int info[0].sex 性别
     * @return int info[0].height 身高
     * @return int info[0].weight 体重
     * @return string info[0].constellation 星座
     * @return string info[0].province 省份
     * @return string info[0].city 城市
     * @return string info[0].district 地区
     * @return string info[0].intr 介绍
     * @return string info[0].signature 签名
     * @return string info[0].label_list 标签列表
     * @return string info[0].name 姓名
     * @return string msg 提示信息
     */
    public function upUserInfo()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('操作成功'), 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $avatar = \App\checkNull($this->avatar);
        $name = \App\checkNull($this->name);
        $audio = \App\checkNull($this->audio);
        $audio_length = \App\checkNull($this->audio_length);
        $sex = \App\checkNull($this->sex);
        $height = \App\checkNull($this->height);
        $weight = \App\checkNull($this->weight);
//        $constellation = \App\checkNull($this->constellation);
        $constellation = $this->constellation;
        $label = \App\checkNull($this->label);
        $province = \App\checkNull($this->province);
        $city = \App\checkNull($this->city);
        $district = \App\checkNull($this->district);
        $intr = \App\checkNull($this->intr);
        $signature = \App\checkNull($this->signature);
        $checkToken = \App\checkToken($uid, $token);
        $language = \App\checkNull($this->language);
        $country = \App\checkNull($this->country);
        $address = \App\checkNull($this->address);


        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $post_data = [];

        if ($avatar) {

            $configpri = \App\getConfigPri();
            $cloudtype = $configpri['cloudtype'];

            $post_data['avatar'] = $avatar;
            if ($cloudtype == 1) {
                $post_data['avatar_thumb'] = $avatar . '?imageView2/2/w/200/h/200';
            } else {
                $post_data['avatar_thumb'] = $avatar;
            }

        }

        if ($name) {

            if ($name == \PhalApi\T('用户已注销') || $name == \PhalApi\T('已注销')) {
                $rs['code'] = 1003;
                $rs['msg'] = \PhalApi\T('请填写正确的昵称');
                return $rs;
            }

            $count = mb_strlen($name);
            if ($count > 10) {
                $rs['code'] = 1002;
                $rs['msg'] = \PhalApi\T('昵称最多10个字');
                return $rs;
            }

            $is_has_sensitive = \App\checkSensitiveWords($name);

            if ($is_has_sensitive) {
                $rs['code'] = 1001;
                $rs['msg'] = \PhalApi\T('昵称输入非法,请重新输入');
                return $rs;
            }

            $post_data['user_nickname'] = $name;
        }

        if ($audio) {
            $post_data['audio'] = $audio;

            if ($audio_length > 15) {
                $audio_length = 15;
            }

            if ($audio_length < 0) {
                $audio_length = 0;
            }

            $post_data['audio_length'] = $audio_length;
        }

        if ($sex) {
            if (!in_array($sex, ['1', '2'])) {
                $rs['code'] = 1002;
                $rs['msg'] = \PhalApi\T('性别错误');
                return $rs;
            }

            $post_data['sex'] = $sex;
        }

        if ($height) {
            if (!is_numeric($height)) {
                $rs['code'] = 1003;
                $rs['msg'] = \PhalApi\T('身高必须填写数字');
                return $rs;
            }

            if ($height > 220) {
                $rs['code'] = 1004;
                $rs['msg'] = \PhalApi\T('身高错误');
                return $rs;
            }

            $post_data['height'] = $height;
        }

        if ($weight) {
            if (!is_numeric($weight)) {
                $rs['code'] = 1005;
                $rs['msg'] = \PhalApi\T('体重必须填写数字');
                return $rs;
            }

            if ($weight > 300) {
                $rs['code'] = 1006;
                $rs['msg'] = \PhalApi\T('体重错误');
                return $rs;
            }

            $post_data['weight'] = $weight;
        }

        if (isset($constellation)) {
            $post_data['constellation'] = $constellation;
        }

        if ($label) {
            $label_a = array_filter(preg_split('/,|，/', $label));

            if (!$label_a) {
                $rs['code'] = 1007;
                $rs['msg'] = \PhalApi\T('请选择至少一个形象标签');
                return $rs;
            } else if (count($label_a) > 3) {
                $rs['code'] = 1008;
                $rs['msg'] = \PhalApi\T('至多选择三个形象标签');
                return $rs;
            }

            $post_data['labelid'] = $label;

        }
        //ggg
        if ($city) {
            $post_data['city'] = htmlspecialchars_decode($city);
        }
        if ($address) {
            $post_data['address'] = $address;
        }
// 		if($province){
// 			if($city=='' || $district==''){
// 				$rs['code'] = 1009;
// 	            $rs['msg'] = \PhalApi\T('请选择所在城市地区');
// 	            return $rs;
// 			}

// 			$post_data['province']=$province;
// 			$post_data['city']=$city;
// 			$post_data['district']=$district;
// 		}

        if ($intr) {
            if (mb_strlen($intr) > 40) {
                $rs['code'] = 1010;
                $rs['msg'] = \PhalApi\T('个人介绍最多40个字');
                return $rs;
            }

            $is_has_sensitive = \App\checkSensitiveWords($intr);
            if ($is_has_sensitive) {
                $rs['code'] = 1011;
                $rs['msg'] = \PhalApi\T('个人介绍输入非法,请重新输入');
                return $rs;
            }

            $post_data['intr'] = $intr;
        }

        if ($signature) {
            if (mb_strlen($signature) > 40) {
                $rs['code'] = 1012;
                $rs['msg'] = \PhalApi\T('个性签名最多40个字');
                return $rs;
            }

            $is_has_sensitive = \App\checkSensitiveWords($signature);
            if ($is_has_sensitive) {
                $rs['code'] = 1013;
                $rs['msg'] = \PhalApi\T('个性签名输入非法,请重新输入');
                return $rs;
            }

            $post_data['signature'] = $signature;
        }

        /*if($country){
            $key='getCountrys';
            $info=\App\getcaches($key);
            if(!$info){
                $json=API_ROOT.'/config/country.json';//文件存放目录
                // 从文件中读取数据到PHP变量
                $json_string = file_get_contents($json);
                 // 用参数true把JSON字符串强制转成PHP数组
                $data = json_decode($json_string, true);

                $info=$data['country']; //国家

                \App\setcaches($key,$info);
            }

            $post_data['country'] = "";
            foreach ($info as $key => $value){
                foreach ($value['lists'] as $k => $v){
                    if(strcasecmp($country, $v['code']) == 0){
                        $post_data['country'] = json_encode($v);
                        break;
                    }
                }
            }
        }*/
        if ($country) {
            $post_data['country'] = $country;
        }
        /*if($language){
            $key='getLanguages';
            $info=\App\getcaches($key);

            if(!$info){
                $json=API_ROOT.'/config/language.json';//文件存放目录
                // 从文件中读取数据到PHP变量
                $json_string = file_get_contents($json);
                 // 用参数true把JSON字符串强制转成PHP数组
                $data = json_decode($json_string, true);

                $info=$data['languages']; //国家

                \App\setcaches($key,$info);
            }

            $post_data['language'] = "";
            foreach ($info as $key => $value){
                foreach ($value['lists'] as $k => $v){
                    if(strcasecmp($language, $v['code']) == 0){
                        $post_data['language'] = json_encode($v);
                        break;
                    }
                }
            }
        }*/
        if ($language) {
            $post_data['language'] = $language;
        }
        if (empty($post_data)) {
            $rs['code'] = 1014;
            $rs['msg'] = \PhalApi\T('至少选择一个修改项');
            return $rs;
        }
        $domain = new Domain_User();
        $info = $domain->upUserInfo($uid, $post_data);

        return $info;
    }

    /**
     * 关注列表
     * @desc 用于获取用户的关注列表
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string info[].fans 粉丝数
     * @return string info[].isvip 是否VIP，0否1是
     * @return string msg 提示信息
     */
    public function getFollowsList()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $p = \App\checkNull($this->p);


        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->getFollowsList($uid, $p);

        $rs['info'] = $info;
        return $rs;
    }

    /**
     * 粉丝列表
     * @desc 用于获取用户的关注列表
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string info[].coin 余额
     * @return string info[].isauth 是否认证，0否1是
     * @return string info[].u2t 是否关注对方，0否1是
     * @return string info[].isvip 是否VIP，0否1是
     * @return string msg 提示信息
     */
    public function getFansList()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $p = \App\checkNull($this->p);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->getFansList($uid, $p);

        $rs['info'] = $info;
        return $rs;
    }

    /**
     * 关注/取消关注
     * @desc 用于关注/取消关注
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string info[0].isattent 关注信息，0表示未关注，1表示已关注
     * @return string msg 提示信息
     */
    public function setAttent()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('操作成功'), 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $touid = \App\checkNull($this->touid);

        if ($uid < 1 || $token == '' || $touid < 1) {
            $rs['code'] = 1001;
            $rs['msg'] = \PhalApi\T('信息错误');
            return $rs;
        }

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->setAttent($uid, $touid);

        return $info;
    }


    /**
     * 拉黑列表
     * @desc 用于获取用户的拉黑列表
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function getBlackList()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $p = \App\checkNull($this->p);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->getBlackList($uid, $p);

        $rs['info'] = $info;
        return $rs;
    }

    /**
     * 拉黑/取消拉黑
     * @desc 用于拉黑/取消拉黑
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string info[0].isblack 拉黑信息，0表示未拉黑，1表示已拉黑
     * @return string msg 提示信息
     */
    public function setBlack()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('操作成功'), 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $touid = \App\checkNull($this->touid);

        if ($uid < 1 || $token == '' || $touid < 1) {
            $rs['code'] = 1001;
            $rs['msg'] = \PhalApi\T('信息错误');
            return $rs;
        }

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->setBlack($uid, $touid);

        return $info;
    }

    /**
     * 更新位置
     * @desc 用于用户每次打开APP时更新位置
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function setLocal()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('操作成功'), 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $lng = \App\checkNull($this->lng);
        $lat = \App\checkNull($this->lat);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->setLocal($uid, $lng, $lat);

        return $rs;
    }

    /**
     * 礼物柜
     * @desc 用于获取主播的收礼物情况
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string info[0].total 总价值
     * @return string info[0].nums 总数量
     * @return array info[0].list 礼物列表
     * @return string info[0].list[].thumb 图片
     * @return string info[0].list[].name 名称
     * @return string info[0].list[].total_nums 数量
     * @return string msg 提示信息
     */
    public function getGiftCab()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $liveuid = \App\checkNull($this->liveuid);

        if ($liveuid < 1) {
            $rs['code'] = 1001;
            $rs['msg'] = \PhalApi\T('信息错误');
            return $rs;
        }

        $isauth = \App\isAuthorAuth($liveuid);

//        if (!$isauth) {
//            $rs['code'] = 1002;
//            $rs['msg'] = \PhalApi\T('该用户尚未认证主播');
//            return $rs;
//        }


        $domain = new Domain_User();
        $info = $domain->getGiftCab($liveuid);

        $rs['info'][0] = $info;
        return $rs;
    }


    /**
     * 个人主页
     * @desc 用于获取主播的个人主页
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string info[0].id 用户ID
     * @return string info[0].level_anchor 主播等级
     * @return string info[0].fans 粉丝数
     * @return string info[0].isvip 是否VIP，0否1是
     * @return string info[0].isvoice 语音开关，0关1开
     * @return string info[0].voice_value 语音价格
     * @return string info[0].isvideo 视频开关，0关1开
     * @return string info[0].video_value 视频价格
     * @return string info[0].isdisturb 勿扰开关，0关1开
     * @return string info[0].goodnums 好评数
     * @return string info[0].badnums 差评数
     * @return string info[0].online 状态，0离线，1勿扰，2在聊，3在线
     * @return string info[0].last_online_time 最后登录
     * @return string info[0].thumb 封面
     * @return array  info[0].photos_list 背景图
     * @return string  info[0].photos_list[].type 类型，0图片1视频
     * @return string  info[0].photos_list[].thumb 图片链接
     * @return string  info[0].photos_list[].href 视频
     * @return string info[0].name 姓名
     * @return string info[0].mobile 手机号
     * @return string info[0].sex 性别
     * @return string info[0].height 身高
     * @return string info[0].weight 体重
     * @return array  info[0].label_list 形象标签
     * @return string info[0].label_list[].name 名称
     * @return string info[0].label_list[].colour 颜色
     * @return string info[0].province 省
     * @return string info[0].city 市
     * @return string info[0].district 区
     * @return string info[0].intr 个人介绍
     * @return string info[0].signature 个性签名
     * @return string info[0].audio 语音介绍
     * @return string info[0].answer_rate 接听率
     * @return string info[0].isattent 是否关注，0否1是
     * @return string info[0].gift_total 礼物总价
     * @return array  info[0].gift_list 礼物列表
     * @return string info[0].gift_list[].name 名称
     * @return string info[0].gift_list[].thumb 图标
     * @return array  info[0].evaluate_list 用户印象
     * @return string info[0].evaluate_list[].name 名称
     * @return string info[0].evaluate_list[].colour 颜色
     * @return string msg 提示信息
     */
    public function getUserHome()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $liveuid = \App\checkNull($this->liveuid);

        if ($liveuid < 1) {
            $rs['code'] = 1001;
            $rs['msg'] = \PhalApi\T('信息错误');
            return $rs;
        }

//        $isauth = \App\isAuthorAuth($liveuid);
//        if (!$isauth) {
//            $rs['code'] = 1002;
//            $rs['msg'] = \PhalApi\T('该用户尚未认证主播');
//            return $rs;
//        }

        $domain = new Domain_User();
        $info = $domain->getUserHome($uid, $liveuid);

        $domain_vip = new Domain_Vip();

        $isvip = 0;
        $vipinfo = $domain_vip->myVip($uid);
        if ($vipinfo['isvip']) {
            $isvip = 1;
        }
        $model = new Model_Photo();
        $where1 = [];
        $where1['uid'] = $liveuid;
        $list = $model->getPhotoList($where1, 1);
        if (!$list) {
            $list = [];
        }
        if (!empty($list)) {
            foreach ($list as $k => $v) {
                $v['thumb'] = \App\get_upload_path($v['thumb']);
                $v['views'] = \App\NumberFormat($v['views']);
                $v['cansee'] = '0';
                if ($v['uid'] == $uid) {
                    $v['cansee'] = '1';
                } else {
                    if ($v['isprivate'] == 1) {
                        $isbuy = $model->isbuy($uid, $v['id']);
                        if ($isbuy || $isvip) {
                            $v['cansee'] = '1';
                        }
                    } else {
                        $v['cansee'] = '1';
                    }
                }
                $list[$k] = $v;
            }
        }
        $info['getHomePhoto'] = $list;

        $model1 = new Model_Dynamic();
        $userinfo = \App\getUserInfo($liveuid);

        $list1 = $model1->getDynamiclists($where1, 1);
        if (!$list1) {
            $list1 = [];
        }
        if (!empty($list1)) {
            foreach ($list1 as $k => $v) {
                $v['datetime'] = \App\datetime($v['addtime']);
                if (!$v['city']) {
                    $v['city'] = \PhalApi\T("好像在火星");
                }
                if ($v['thumb']) {
                    $thumbs = explode(";", $v['thumb']);
                    foreach ($thumbs as $kk => $vv) {
                        if ($vv) {
                            $thumbs[$kk] = \App\get_upload_path($vv);
                        }
                    }
                    $v['thumbs'] = $thumbs;
                } else {
                    $v['thumbs'] = array();
                }

                if ($v['video_thumb']) {
                    $v['video_thumb'] = \App\get_upload_path($v['video_thumb']);
                }

                if ($v['voice']) {
                    $v['voice'] = \App\get_upload_path($v['voice']);
                }
                if ($v['href']) {
                    $v['href'] = \App\get_upload_path($v['href']);
                }

                $v['likes'] = \App\NumberFormat($v['likes']);
                $v['comments'] = \App\NumberFormat($v['comments']);

                if ($v['uid'] == $uid) {
                    $v['islike'] = '0';
                } else {
                    $v['islike'] = $model1->islike($uid, $v['id']);
                }
                //print_r($userinfo);exit;
                $user['id'] = $userinfo['id'];
                $user['user_nickname'] = $userinfo['user_nickname'];
                $user['avatar'] = $userinfo['avatar'];
                $user['avatar_thumb'] = $userinfo['avatar_thumb'];
                $user['sex'] = $userinfo['sex'];
                $user['country'] = $userinfo['country'];
                $user['level'] = $userinfo['level'];
                $user['levelData'] = $userinfo['levelData'];
                $user['levelAnchorData'] = $userinfo['levelAnchorData'];
                $user['isAttention'] = \App\isAttention($uid, $v['uid']);
                $user['constellation'] = $userinfo['constellation'];
                $user['video_value'] = $userinfo['video_value'];
                $user['voice_value'] = $userinfo['voice_value'];


                $v['userinfo'] = $user;

                $list1[$k] = $v;
            }
        }
        $info['getHomeDynamic'] = $list1;

        $model2 = new Model_Video();
        $list2 = $model2->getVideoList($where1, 1);
        if (!$list2) {
            $list2 = [];
        }
        if (!empty($list2)) {
            foreach ($list2 as $k => $v) {
                $v['thumb'] = \App\get_upload_path($v['thumb']);
                $v['thumb_s'] = \App\get_upload_path($v['thumb_s']);
                $v['href'] = \App\get_upload_path($v['href']);
                $v['likes'] = \App\NumberFormat($v['likes']);
                $v['views'] = \App\NumberFormat($v['views']);
                $v['shares'] = \App\NumberFormat($v['shares']);
                $v['comments'] = \App\NumberFormat($v['comments']);
                $v['cansee'] = '0';
                if ($v['uid'] == $uid) {
                    $v['islike'] = '0';
                    $v['cansee'] = '1';
                } else {
                    $v['islike'] = $model2->islike($uid, $v['id']);

                    if ($v['isprivate'] == 1) {
                        $isbuy = $model2->isbuy($uid, $v['id']);
                        if ($isbuy || $isvip) {
                            $v['cansee'] = '1';
                        }
                    } else {
                        $v['cansee'] = '1';
                    }
                }

                $user['id'] = $userinfo['id'];
                $user['user_nickname'] = $userinfo['user_nickname'];
                $user['avatar'] = $userinfo['avatar'];
                $user['avatar_thumb'] = $userinfo['avatar_thumb'];
                $user['online'] = $userinfo['online'];
                $user['isvideo'] = $userinfo['isvideo'];
                $user['isvoice'] = $userinfo['isvoice'];
                $user['video_value'] = $userinfo['video_value'];
                $user['voice_value'] = $userinfo['voice_value'];
                $user['levelData'] = $userinfo['levelData'];
                $user['levelAnchorData'] = $userinfo['levelAnchorData'];
                $v['userinfo'] = $user;

                $list2[$k] = $v;
            }
        }
        $info['GetHomeVideo'] = $list2;
        //获取直播信息
        $Zlive_domain = new Model_Zlive();
        $live_info = $Zlive_domain->getLiveInfo($liveuid);
        $islive = 1;
        if (!$live_info) {
            $islive = 0;
            $live_info = [];
        }
        $info['islive'] = $islive;
        $info['live_info'] = $live_info;

        $rs['info'][0] = $info;
        return $rs;
    }


    /**
     * 用户举报--类型
     * @desc 用于获取举报类型
     * @return int code 操作码，0表示成功
     * @return array info 列表
     * @return string info[].name 类型名称
     * @return string msg 提示信息
     */
    public function getReportClass()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());
//        $domain = new Domain_User();
//        $info = $domain->getReportClass();

        $info = UserReportClassifyDomain::getReportClassify(1,$this->langId);
        $rs['info'] = $info;
        return $rs;
    }


    /**
     * 用户举报
     * @desc 用于用户举报
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string info[0].msg 举报成功
     * @return string msg 提示信息
     */
    public function setReport()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('举报成功'), 'info' => array());

        $uid = $this->uid;
        $token = \App\checkNull($this->token);
        $touid = $this->touid;
        $content = \App\checkNull($this->content);
        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        if (!$content) {
            $rs['code'] = 1001;
            $rs['msg'] = \PhalApi\T('举报内容不能为空');
            return $rs;
        }

        if (mb_strlen($account) > 200) {
            $rs['code'] = 1002;
            $rs['msg'] = \PhalApi\T('账号长度不能超过200个字符');
            return $rs;
        }

        $domain = new Domain_User();
        $info = $domain->setReport($uid, $touid, $content);
        if ($info === false) {
            $rs['code'] = 1002;
            $rs['msg'] = \PhalApi\T('举报失败，请重试');
            return $rs;
        }

        return $rs;
    }

    /**
     * 用户预设美颜
     * @desc 用于用户预设美颜
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function setBeauty()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('设置成功'), 'info' => array());

        $uid = $this->uid;
        $token = \App\checkNull($this->token);
        $type = $this->type;
        $preinstall = $this->preinstall;

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }


        $domain = new Domain_User();
        $info = $domain->setBeauty($uid, $type, $preinstall);
        if (!$info) {
            $rs['code'] = 1002;
            $rs['msg'] = \PhalApi\T('设置失败，请重试');
            return $rs;
        }

        return $rs;
    }


    /**
     * 获取预设美颜
     * @desc 用于用户获取预设美颜
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function getBeauty()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = $this->uid;
        $token = \App\checkNull($this->token);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }


        $domain = new Domain_User();
        $info = $domain->getBeauty($uid);

        $rs['info'][0] = $info;

        return $rs;
    }

    /**
     * 形象标签列表
     * @desc 用于获取形象标签列表
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string info[].id
     * @return string info[].name 名称
     * @return string info[].colour 颜色
     * @return string msg 提示信息
     */
    public function getLabelList()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $domain = new Domain_User();

        $list = $domain->getLabelList();

        $rs['info'] = $list;

        return $rs;
    }

    /**
     * 获取用户的基本资料
     * @desc 获取用户的基本资料
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string info[0].avatar 头像
     * @return string info[0].avatar_thumb 小头像
     * @return string info[0].user_nickname 昵称
     * @return string info[0].audio 语音自我介绍
     * @return int info[0].audio_length 语音时长
     * @return int info[0].sex 性别
     * @return int info[0].height 身高
     * @return int info[0].weight 体重
     * @return string info[0].constellation 星座
     * @return string info[0].province 省份
     * @return string info[0].city 城市
     * @return string info[0].district 地区
     * @return string info[0].intr 介绍
     * @return string info[0].signature 签名
     * @return string info[0].label_list 标签列表
     * @return string info[0].name 姓名
     * @return string msg 提示信息
     */
    public function getUserMaterial()
    {
        //guo
        error_reporting(E_ERROR);
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);


        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();

        $info = $domain->getUserMaterial($uid);

        $rs['info'][0] = $info;

        return $rs;
    }


    /**
     * 检查用户是否开启了青少年模式
     * @desc 检查用户是否开启了青少年模式
     * @return int code 状态码，0表示成功
     * @return string msg 提示信息
     * @return array info 返回信息
     * @return array info[0].is_setpassword 是否设置过密码 0 否 1 是
     * @return array info[0].status 是否开启青少年模式 0 否 1 是
     * @return array info[0].is_tip 是否提示用户弹窗显示青少年模式下不能继续使用app   0 否  1 是
     * @return array info[0].tips  弹窗显示青少年模式下不能继续使用app的提示语
     * @return array info[0].teenager_des  青少年模式提示语
     */
    public function checkTeenager()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);

        $checkToken = \App\checkToken($uid, $token);

        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $res = $domain->checkTeenager($uid);

        $configpub = \App\getConfigPub();

        $res['info'][0]['is_tip'] = '0';
        $res['info'][0]['tips'] = '';
        $res['info'][0]['teenager_des'] = $configpub['teenager_des'];

        //开启了青少年模式
        if ($res['info'][0]['is_setpassword'] && $res['info'][0]['status']) {
            $overtime = $domain->checkTeenagerIsOvertime($uid);

            if ($overtime['code'] != 0) {
                $res['info'][0]['is_tip'] = '1';
                $res['info'][0]['tips'] = $overtime['msg'];
            }
        }

        return $res;
    }


    /**
     * 用户开启青少年模式/初次设置密码后重新设置密码
     * @desc 用户开启青少年模式/初次设置密码后重新设置密码
     * @return int code 状态码，0表示成功
     * @return string msg 提示信息
     * @return array info 返回信息
     */
    public function setTeenagerPassword()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('青少年模式开启成功'), 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $password = \App\checkNull($this->password);
        $type = \App\checkNull($this->type);

        $checkToken = \App\checkToken($uid, $token);

        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        if (mb_strlen($password) != 4) {
            $rs['code'] = 1001;
            $rs['msg'] = \PhalApi\T('密码必须为4位');
            return $rs;
        }

        $domain = new Domain_User();
        $res = $domain->setTeenagerPassword($uid, $password, $type);

        if ($res == 1001) {
            $rs['code'] = 1002;
            $rs['msg'] = \PhalApi\T('密码错误');
            return $rs;
        }

        if ($res == 1002) {
            $rs['code'] = 1003;
            $rs['msg'] = \PhalApi\T('密码设置失败,请稍后重试');
            return $rs;
        }

        return $rs;
    }


    /**
     * 用户修改青少年模式密码
     * @desc 用户修改青少年模式密码
     * @return int code 状态码,0表示成功
     * @return string msg 提示信息
     * @return array info 返回信息
     */
    public function updateTeenagerPassword()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('密码修改成功'), 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $oldpassword = \App\checkNull($this->oldpassword);
        $password = \App\checkNull($this->password);

        if (!$oldpassword) {
            $rs['code'] = 1001;
            $rs['msg'] = \PhalApi\T('请输入原密码');
            return $rs;
        }

        if (mb_strlen($oldpassword) != 4) {
            $rs['code'] = 1002;
            $rs['msg'] = \PhalApi\T('原密码长度必须为4位');
            return $rs;
        }

        if (!$password) {
            $rs['code'] = 1001;
            $rs['msg'] = \PhalApi\T('请输入新密码');
            return $rs;
        }

        if (mb_strlen($password) != 4) {
            $rs['code'] = 1002;
            $rs['msg'] = \PhalApi\T('新密码长度必须为4位');
            return $rs;
        }

        $checkToken = \App\checkToken($uid, $token);

        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $res = $domain->updateTeenagerPassword($uid, $oldpassword, $password);

        if ($res == 1001) {
            $rs['code'] = 1003;
            $rs['msg'] = \PhalApi\T('你还未设置密码');
            return $rs;
        }

        if ($res == 1002) {
            $rs['code'] = 1004;
            $rs['msg'] = \PhalApi\T('原密码错误');
            return $rs;
        }

        if (!$res) {
            $rs['code'] = 1005;
            $rs['msg'] = \PhalApi\T('密码修改失败');
            return $rs;
        }

        return $rs;
    }


    /**
     * 用户关闭青少年模式
     * @return int code 状态码，0表示成功
     * @return string msg 提示信息
     * @return array info 返回信息
     */
    public function closeTeenager()
    {

        $rs = array('code' => 0, 'msg' => \PhalApi\T('青少年模式关闭成功'), 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $password = \App\checkNull($this->password);

        if (!$password) {
            $rs['code'] = 1001;
            $rs['msg'] = \PhalApi\T('请输入密码');
            return $rs;
        }

        if (mb_strlen($password) != 4) {
            $rs['code'] = 1002;
            $rs['msg'] = \PhalApi\T('密码长度必须为4位');
            return $rs;
        }

        $checkToken = \App\checkToken($uid, $token);

        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $res = $domain->closeTeenager($uid, $password);
        if ($res == 1001) {
            $rs['code'] = 1003;
            $rs['msg'] = \PhalApi\T('你还未开启青少年模式');
            return $rs;
        }

        if ($res == 1002) {
            $rs['code'] = 1004;
            $rs['msg'] = \PhalApi\T('青少年模式未开启');
            return $rs;
        }

        if ($res == 1003) {
            $rs['code'] = 1005;
            $rs['msg'] = \PhalApi\T('密码错误');
            return $rs;
        }

        if (!$res) {
            $rs['code'] = 1006;
            $rs['msg'] = \PhalApi\T('青少年模式关闭失败');
            return $rs;
        }

        return $rs;
    }

    /**
     * 定时增加用户使用青少年模式时间
     * @desc 定时增加用户使用青少年模式时间
     * @return int code 状态码，0表示成功
     * @return string msg 提示信息
     * @return array info 返回信息
     */
    public function addTeenagerTime()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);

        $checkToken = \App\checkToken($uid, $token);

        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $res = $domain->addTeenagerTime($uid);

        return $res;
    }

    /**
     * 登录奖励
     * @desc 用于用户登录奖励
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string info[0].bonus_switch 登录开关，0表示未开启
     * @return string info[0].bonus_day 登录天数,0表示已奖励
     * @return string info[0].count_day 连续登陆天数
     * @return string info[0].bonus_list 登录奖励列表
     * @return string info[0].bonus_list[].day 登录天数
     * @return string info[0].bonus_list[].coin 登录奖励
     * @return string msg 提示信息
     */
    public function Bonus()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }
        $domain = new Domain_User();
        $info = $domain->LoginBonus($uid);

        $rs['info'][0] = $info;

        return $rs;
    }

    /**
     * 登录奖励
     * @desc 用于用户登录奖励
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string info[0].bonus_switch 登录开关，0表示未开启
     * @return string info[0].bonus_day 登录天数,0表示已奖励
     * @return string msg 提示信息
     */
    public function getBonus()
    {
        $rs = array('code' => 0, 'msg' => \PhalApi\T('领取成功'), 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }
        $domain = new Domain_User();
        $info = $domain->getLoginBonus($uid);

        if (!$info) {
            $rs['code'] = 1001;
            $rs['msg'] = \PhalApi\T('领取失败');
            return $rs;
        }

        return $rs;
    }

    /**
     * 获取任务中心列表
     * @desc 获取任务中心列表
     * @return int code 状态码,0表示成功
     * @return string msg 提示信息
     * @return array info 返回信息
     */
    public function getTaskList()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $result = $domain->getTaskList($uid);
        $rs['info'][0] = $result;
        return $rs;
    }

    /**
     * 领取每日任务奖励
     * @return int code 状态码,0表示成功
     * @return string msg 提示信息
     * @return array info 返回信息
     */
    public function receiveTaskReward()
    {

        $rs = array('code' => 0, 'msg' => '', 'info' => array());
        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $type = \App\checkNull($this->type);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        if (!in_array($type, ['publish_dynamic', 'like_dynamic', 'send_privatemsg', 'voice_call', 'video_call', 'open_live'])) {
            $rs['code'] = 1001;
            $rs['msg'] = \PhalApi\T('参数错误');
            return $rs;
        }

        $domain = new Domain_User();
        $res = $domain->receiveTaskReward($uid, $type);
        return $res;
    }

    /**
     * 守护榜单
     * @desc 获取守护榜单
     * @return int code 操作码 0表示成功
     * @return string msg 提示信息
     * @return array info
     * @return string info[0]['user_nickname'] 用户昵称
     * @return string info[0]['avatar_thumb'] 用户头像
     * @return string info[0]['totalcoin'] 用户钻石数
     * @return string info[0]['uid'] 用户id
     * @return string info[0]['levelAnchor'] 用户等级
     * @return string info[0]['isAttention'] 是否关注用户 0 否 1 是
     **/

    public function guardList()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $p = \App\checkNull($this->p);
        $type = \App\checkNull($this->type);

        $domain = new Domain_User();
        $res = $domain->guardList($uid, $type, $p);

        $rs['info'] = $res;
        return $rs;
    }

    /**
     * 随机获取搭讪话术
     * @desc 随机获取搭讪话术
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function getRandomSayhi()
    {
        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $res = $domain->getRandomSayhi($uid);
        $rs['info'][0]['str'] = $res; //iOS专用

        return $rs;
    }

    /**
     * 添加第一次搭讪记录
     * @desc 添加第一次搭讪记录
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */

    public function addFirstSayhiRecord()
    {

        $rs = array('code' => 0, 'msg' => '', 'info' => array());

        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $touid = \App\checkNull($this->touid);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $res = $domain->addFirstSayhiRecord($uid, $touid);
        $sayhi_msg = $domain->getRandomSayhi($uid); //安卓专用

        $rs['info'][0]['str'] = $sayhi_msg;
        return $rs;
    }


    /**
     * 获取我喜欢的用户列表
     * @desc 获取我喜欢的用户列表
     * @return int code 操作码，0表示成功
     * @return array info
     * @return string msg 提示信息
     */
    public function getLikeList()
    {
        $uid = \App\checkNull($this->uid);
        $token = \App\checkNull($this->token);
        $p = \App\checkNull($this->p);

        $checkToken = \App\checkToken($uid, $token);
        if ($checkToken == 700) {
            $rs['code'] = $checkToken;
            $rs['msg'] = \PhalApi\T('您的登陆状态失效，请重新登陆！');
            return $rs;
        }

        $domain = new Domain_User();
        $res = $domain->getLikeList($uid, $p);
        $rs['info'] = $res;
        return $rs;
    }

}
